package com.hsp.Demo_12_enum;

public class Demo_09 {
    public static void main(String[] args) {
        Car car = new Car(40.5);
        car.new Air().flow();
        car.getAir().flow();
    }
}

class Car{

    private double temperature;

    public Car(){}

    public Car(double temperature){
        this.temperature = temperature;
    }

    public class Air{
        public void flow(){
            if(temperature > 40.0){
                System.out.println("吹冷风");
            }else if(temperature < 0){
                System.out.println("吹热风");
            }else{
                System.out.println("温度很合适，不需要空调");
            }
        }
    }

    public Air getAir(){
        return new Air();
    }
}